const api = require("api.js");
const A = require('../vwx/uset.js');

module.exports = {
    ...api,
    getTData: (_url, josn) => {
        return new Promise((resolve, reject) => {
            if (typeof _url == 'string') {
                _url = _url;
            } else {
                _url.url = _url.url;
            }
            console.log(A);
            A.RSG(_url, josn).then(data => {
                resolve(data);
            }, err => {
                reject(err);
            })
        })
    },
    postTData: (_url, json) => {
        return new Promise((resolve, reject) => {
            if (typeof _url == 'string') {
                _url = _url;
            } else {
                _url.url = _url.url
            }
            A.RSP(_url, json).then(data => {
                wx.stopPullDownRefresh();
                resolve(data);
            }, err => {
                reject(err);
            })
        })
    }
}